Skip to main content

C development in Linux

OS: Ubuntu 20.04 LTS

Folder Structure

Create the git folder (and the standard subfolder structure of gqc) in user ~Home directory.

Setting up the environment

  1. Make sure everything is up-to-date and install the packaged build tools

    sudo apt update
    sudo apt upgrade
    sudo apt install build-essential
  2. Verify the installation

    whereis gcc make
    gcc --version
    make -v
  3. Install man pages (optional):

    sudo apt-get install manpages-dev man-db manpages-posix-dev

    Test:

    man 3 scanf
    man 2 execve
    man 2 fork
  4. Compiling and running

    make test

    For compiling and creating the executable of a c code file with name <test>.c
    Equivalent to gcc test.c -o test